CREATE PROCEDURE [dbo].[GetEntriesPastDueDate]

AS
SELECT     EntryLog.EntryLogID
FROM         EntryLog INNER JOIN
                      Users ON EntryLog.UserID = Users.UserID INNER JOIN
                      Projects ON EntryLog.ProjectID = Projects.ProjectID AND EntryLog.EntryDate > Projects.EstCompletionDate
WHERE     (EntryLog.HasBeenBilled = 0) AND (Users.IsActive = 1) AND (Projects.ProjectTypeID <> 3)

